package com.telecom.at.front;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.JSONArray;
import org.json.JSONObject;
import com.telecom.at.db.dac.Dac;
import com.telecom.at.db.model.NumOfAccount;
import com.telecom.at.db.model.ParaOfIndex;
import com.telecom.at.db.model.User;

@WebServlet("/front/MyChartOfCity")
public class MyChartOfCity extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
  
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		
		List<ParaOfIndex> paraList = Dac.getInstance().getIndex();
		
		long sumFlow = paraList.get(0).getIndexValue();
		
		long sumOfAccount = paraList.get(1).getIndexValue();
		long sumOfActiveAccountOf100M = paraList.get(2).getIndexValue();
		long getAbnormalAccount = paraList.get(3).getIndexValue();
		request.setAttribute("sumFlow", sumFlow);
		request.setAttribute("sumOfAccount", sumOfAccount);
		request.setAttribute("sumOfActiveAccountOf100M", sumOfActiveAccountOf100M);
		request.setAttribute("getAbnormalAccount", getAbnormalAccount);
		request.getRequestDispatcher("/WEB-INF/jsp/front/MyChartOfCity.jsp").forward(request, response);		
	}

}
